package com.springboot.dao.impl;

import com.google.gson.Gson;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.springboot.dao.SysLogDao;
import com.springboot.domain.SysLog;

@Repository
@Slf4j
public class SysLogDaoImp implements SysLogDao {


	@Override
	public void saveSysLog(SysLog syslog) {
		StringBuffer sql = new StringBuffer("insert into sys_log ");
		sql.append("(id,username,operation,time,method,params,ip,create_time) ");
		sql.append("values(seq_sys_log.nextval,:username,:operation,:time,:method,");
		sql.append(":params,:ip,:createTime)");

		Gson gson = new Gson();
		log.info(sql.toString());
		log.info(gson.toJson(syslog));
	}

}
